﻿@{
    ViewBag.Title = "设备管理系统";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section header{
    @*//start*@
    <script src="JQuery/jquery/jquery-1.10.2.min.js"></script>
    <link href="Theme/base/style.css" rel="stylesheet" />
    <link type="text/css" rel="stylesheet" href="http://js.arcgis.com/3.11/esri/css/esri.css" />
    <link type="text/css" rel="stylesheet" href="http://js.arcgis.com/3.11/dijit/themes/tundra/tundra.css" />
    <script src="http://js.arcgis.com/3.12/"></script>
    @*//end*@
    <script type="text/javascript">
        ///<summary>
        /// Home页面类
        ///</summary>
        var windowH = $(window).height();
        function Home() {
            ///<summary>
            /// 初始化页面
            ///</summary>
            this.init = function () {
                initClaimingGrid();
                initClaimedGrid();
                initFastBar();
                //initBGTip();
            };

            ///<summary>
            /// 初始化新到工作的grid
            ///</summary>

            function initClaimingGrid() {
                $("#Claiming_Home_Index").jqGrid({
                    url: "/Home/GetClaimingTasks",
                    datatype: "json",
                    mtype: "post",
                    colNames: ['WorktaskInsId', 'operatorInsId', '业务名称', '任务名称', '提交人', '到达时间', '操作'],
                    colModel: [
                        { name: 'WorktaskInsId', index: 'WorktaskInsId', align: "center", sortable: false, hidden: true },
                        { name: 'operatorInsId', index: 'operatorInsId', align: "center", sortable: false, hidden: true },
                        { name: 'FlowInsCaption', index: 'FlowInsCaption', width: 300, align: "center", formatter: formatCaption, sortable: false },
                        { name: 'TaskCaption', index: 'TaskCaption', align: "center", width: 150, sortable: false },
                        { name: 'pOperatedDes', index: 'pOperatedDes', width: 100, align: "center", sortable: false },
                        { name: 'OperDateTime', index: 'OperDateTime', align: "center", width: 100, sortable: false },
                        { name: "WorkFlowId", index: "WorkFlowId", width: 80, align: "center", sortable: false, hidden: false, formatter: formatOption }
                    ],
                    loadError: function (xhr, status) {
                        alertMsg.error(xhr.responseText);
                    },
                    loadComplete: function (xhr) {
                        $("#Claiming_Home_Index a[target=_navTab]").each(function () {
                            $(this).click(function (event) {
                                var $this = $(this);
                                var title = $this.attr("title") || $this.text();
                                var tabid = $this.attr("rel") || "_blank";
                                var fresh = eval($this.attr("fresh") || "true");
                                var external = eval($this.attr("external") || "false");
                                var url = $this.attr("href");
                                DWZ.debug(url);
                                if (!url.isFinishedTm()) {
                                    alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
                                    return false;
                                }
                                navTab.openTab(tabid, url, { title: title, fresh: fresh, external: external });

                                event.preventDefault();
                            });
                        });
                        var ajaxbg = $("#background,#progressBar,#lui_Claiming_Home_Index");
                        ajaxbg.hide();
                    },
                    autowidth: true,
                    shrinkToFit: true,
                    multiselect: false,
                    multiselectWidth: 50,
                    sortable: false,
                    viewrecords: true,
                    sortorder: "desc",
                    jsonReader: {
                        repeatitems: false
                    },
                    rowNum: -1,
                    height: (windowH - 458) / 2
                }).navGrid('#pager', { edit: false, add: false, del: false, refresh: false, search: false });
            }
            ///<summary>
            /// 初始化代办工作的grid
            ///</summary>
            function initClaimedGrid() {
                $("#Claimed_Home_Index").jqGrid({
                    url: "/Home/GetClaimedTasks",
                    datatype: "json",
                    mtype: "post",
                    colNames: ['WorktaskInsId', 'operatorInsId', '业务名称', '任务名称', '提交人', '到达时间', '操作'],
                    colModel: [
                        { name: 'WorktaskInsId', index: 'WorktaskInsId', align: "center", sortable: false, hidden: true },
                        { name: 'operatorInsId', index: 'operatorInsId', align: "center", sortable: false, hidden: true },
                        { name: 'FlowInsCaption', index: 'FlowInsCaption', formatter: formatCaption, width: 300, align: "center", sortable: false },
                        { name: 'TaskCaption', index: 'TaskCaption', align: "center", width: 150, sortable: false },
                        { name: 'OperatedDes', index: 'OperatedDes', width: 100, align: "center", sortable: false },
                        { name: 'OperDateTime', index: 'OperDateTime', align: "center", width: 100, sortable: false },
                    //{name: 'taskEndTime', index: 'taskEndTime', align: "center", width: 100, sortable: false },
                        { name: "WorkFlowId", index: "WorkFlowId", width: 80, align: "center", sortable: false, hidden: false, formatter: formatOption }
                    ],
                    loadError: function (xhr, status) {
                        alertMsg.error(xhr.responseText);
                    },
                    loadComplete: function (xhr) {
                        $("#Claimed_Home_Index a[target=_navTab]").each(function () {
                            $(this).click(function (event) {
                                var $this = $(this);
                                var title = $this.attr("title") || $this.text();
                                var tabid = $this.attr("rel") || "_blank";
                                var fresh = eval($this.attr("fresh") || "true");
                                var external = eval($this.attr("external") || "false");
                                var url = $this.attr("href");
                                DWZ.debug(url);
                                if (!url.isFinishedTm()) {
                                    alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
                                    return false;
                                }
                                navTab.openTab(tabid, url, { title: title, fresh: fresh, external: external });
                                event.preventDefault();
                            });
                        });
                        var ajaxbg = $("#background,#progressBar,#lui_Claimed_Home_Index");
                        ajaxbg.hide();
                    },
                    autowidth: true,
                    shrinkToFit: true,
                    multiselect: false,
                    multiselectWidth: 50,
                    sortable: false,
                    viewrecords: true,
                    sortorder: "desc",
                    jsonReader: {
                        repeatitems: false
                    },
                    rowNum: -1,
                    height: (windowH - 458) / 2
                }).navGrid('#pager', { edit: false, add: false, del: false, refresh: false, search: false });

            }
            ///<summary>
            /// 格式化 业务名称列 上的链接
            ///</summary>
            function formatCaption(cellvalue, options, rowObject) {
                if ("@KingRoad.EPM.Common.Configuration.Settings.Instance.FundPlanWFId" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.ContractWFId" == rowObject.workflowId
                || "@KingRoad.EPM.Common.Configuration.Settings.Instance.VisionFundPlanWFId" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.VerifyFundPlanWFId" == rowObject.workflowId
                || "@KingRoad.EPM.Common.Configuration.Settings.Instance.SupervisingPlanWFId" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.ImprestWFId" == rowObject.workflowId
                 || "@KingRoad.EPM.Common.Configuration.Settings.Instance.VisionImprestWFId" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.VerifyImprestWFId" == rowObject.workflowId
                  || "@KingRoad.EPM.Common.Configuration.Settings.Instance.SupervisingImprestWFId" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzToWzbzWfID" == rowObject.workflowId
                  || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzToZjbzWfID" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzToXtbzWfID" == rowObject.workflowId
                  || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzToZgbWfID" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzToAjbzWfID" == rowObject.workflowId
                  || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzToGcbzToHtbzWfID" == rowObject.workflowId || "@KingRoad.EPM.Common.Configuration.Settings.Instance.CwbzWfID" == rowObject.workflowId
                ) {
                    return '<a href="/FundManage/Process/Ctrl?operatorInsId=' + rowObject.operatorInsId + '" target="_navTab" rel="workFlow.Replay" style="color:Blue">' + rowObject.FlowInsCaption + '</a>';
                }
                else {
                    return '<a href="/WorkFlow/Ctrl/Index?worktaskInsid=' + rowObject.WorktaskInsId + '&operatorInsId=' + rowObject.operatorInsId + '" target="_navTab" rel="ctrlworkflow" style="color:Blue">' + rowObject.FlowInsCaption + '</a>';
                }
            }
            ///<summary>
            /// 格式化 操作列 上的链接
            ///</summary>
            function formatOption(cellvalue, options, rowObject) {
                return '<a style="font-size:12px;margin-left:10px;color:red" title="流程图"  alt="查看流程图" href="/WorkFlow/WorkflowMap/Index?workflowId=' + rowObject.workflowId + '&workflowInsId=' + rowObject.workflowInsId + '" target="_navTab" rel="workflowmap" >查看流程图</a>';
            }

            ///<summary>
            /// 初始化 快捷操作 栏
            ///</summary>
            function initFastBar() {
                var OLD_HTML = ""; //记录当前图标html
                //绑定快捷操作菜单click
                $(".fast_bar .a_icon[target='_navTab']").die("click").live("click", function (e) {
                    var $this = $(this);
                    var title = $this.attr("title") || $this.text();
                    var tabid = $this.attr("rel") || "_blank";
                    var fresh = eval($this.attr("fresh") || "true");
                    var external = eval($this.attr("external") || "false");
                    var url = $this.attr("url");
                    DWZ.debug(url);
                    if (!url.isFinishedTm()) {
                        alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
                        return false;
                    }
                    navTab.openTab(tabid, url, { title: title, fresh: fresh, external: external });
                    e.preventDefault();
                });
                //绑定管理按钮click
                $("#manageBtn_Home_Index").click(function (e) {
                    OLD_HTML = $(".fast_bar").html(); //记录当前图标html
                    $(this).hide(); //隐藏 管理
                    //复制 添加
                    var count = $(".fast_bar li").size();
                    if (count < 10) {
                        for (var i = 0; i < 10 - count; i++) {
                            $(".fast_bar ul").append('<li class="li_add"><a class="a_icon" href="javascript:void(0);"><img src="/Content/icon/Index/add_btn.png"><br /><span>添加</span></a> </li>');
                        }
                    }
                    $(".fast_bar .a_icon").addClass("a_icon_edit"); //显示 虚线框
                    $(".fast_bar .a_icon[target='_navTab']").attr("target", "_move"); //变为可移动；
                    $("#saveBtn_Home_Index,#backBtn_Home_Index,.fast_bar .li_add,.fast_bar .btn_bar").show(); //显示 保存 取消 替换 删除 添加
                    initDrag();
                    e.preventDefault();
                });
                //绑定保存按钮click
                $("#saveBtn_Home_Index").click(function (e) {
                    //将数据发送给服务器
                    var moduleIds = "";
                    $(".fast_bar .a_icon[moduleId]").each(function () {
                        moduleIds += $(this).attr("moduleId") + ",";
                    });
                    moduleIds = moduleIds.substr(0, moduleIds.length - 1);
                    $.post("/Home/SaveFastBar", { "moduleIds": moduleIds }, function (data) {
                        DWZ.ajaxDone(data);
                        if (data.statusCode == DWZ.statusCode.ok) {
                            $("#manageBtn_Home_Index").show(); //显示 管理
                            $(".fast_bar .a_icon").removeClass("a_icon_edit"); //取消 虚线框
                            $(".fast_bar .a_icon[target='_move']").attr("target", "_navTab"); //变为可点击；
                            $("#saveBtn_Home_Index,#backBtn_Home_Index,.fast_bar .btn_bar,.fast_bar .li_add").hide(); //隐藏 保存 取消 替换 删除 添加
                            oldHtml = $(".fast_bar").html(); //记录当前图标
                            stopDrag();
                        }
                    });
                    e.preventDefault();
                });
                //绑定取消按钮click
                $("#backBtn_Home_Index").click(function (e) {
                    $("#manageBtn_Home_Index").show(); //显示 管理
                    $(".fast_bar .a_icon").removeClass("a_icon_edit"); //取消 虚线框
                    $(".fast_bar .a_icon[target='_move']").attr("target", "_navTab"); //变为可点击；
                    $("#saveBtn_Home_Index,#backBtn_Home_Index,.fast_bar .btn_bar,.fast_bar .li_add").hide(); //隐藏 保存 取消 替换 删除 添加
                    $(".fast_bar").html(OLD_HTML)//还原当前图标
                    stopDrag();
                    e.preventDefault();
                });
                //绑定删除按钮click
                $(".fast_bar .btn_del").live("click", function (e) {
                    if ($(".fast_bar a[target]").size() < 2) {
                        alertMsg.warn("请至少保留一个快捷操作菜单！");
                    }
                    else {
                        $(this).closest("li").remove();
                        $(".fast_bar ul").append('<li class="li_add"><a class="a_icon a_icon_edit" href="javascript:void(0);"><img src="/Content/icon/Index/add_btn.png"><br /><span>添加</span></a> </li>');
                        $(".fast_bar ul li:last").show();
                    }
                    e.preventDefault();
                });
                //绑定添加按钮、替换按钮click
                $(".fast_bar .btn_edit,.li_add .a_icon").live("click", function (e) {
                    $.pdialog.open("/Permission/Module/ModuleList?index=" + $(".fast_bar li").index($(this).closest("li")), "ShowModeleList_Home_Index", "请选择快捷操作菜单", { "width": "730", "height": "500", "mask": "true" });
                    e.preventDefault();
                });
                //拖拽 换位置
                function initDrag() {
                    var isDrag = false; //拖拽状态 
                    var fistPos = $(".fast_bar .a_icon[target]:first").closest("li").offset(); //第一个对象的坐标
                    $(".fast_bar .a_icon[target='_move']")
                        .die("click").live("click", function (e) { e.preventDefault(); })//禁止点击
                        .live("mouseover", function () {
                            $(this).css("cursor", "move"); //$(this).next(".btn_bar").show(); 
                        })
                        .live("mouseout", function () {
                            $(this).css("cursor", "pointer"); // $(this).next(".btn_bar").hide();
                        })
                        .live("mousedown", function (e) {
                            var $moveIcon = $(this).closest("li"); //拖拽对象
                            isDrag = true;
                            $moveIcon.addClass("moveIcon").css({ "opacity": 0.8 }).offset({ top: e.pageY - 45, left: e.pageX - 45 });
                            $("<li id='tempIcon'><a  class='a_icon a_icon_edit'></a></li>").insertBefore($moveIcon); //插入占位虚线框
                        });
                    $(document).mousemove(function (e) {
                        if (!isDrag) return false;
                        $(".moveIcon").offset({ top: e.pageY - 45, left: e.pageX - 45 });

                        $(".fast_bar .a_icon[target='_move']").each(function () {
                            var $tarIcon = $(this).closest("li"); //目标对象
                            var movePos = $(".moveIcon").offset(); //拖拽对象的坐标
                            var tarPos = $tarIcon.offset(); //目标对象的坐标
                            if (movePos.left < fistPos.left && movePos.top < fistPos.top + 90) {
                                $("#tempIcon").insertBefore($(".fast_bar .a_icon[target='_move']:first").closest("li"));
                            }
                            else if (movePos.left > tarPos.left && movePos.top > tarPos.top) {
                                $("#tempIcon").insertAfter($tarIcon);

                            }
                            //$("#tt").text("【movePos】left" + movePos.left + "top" + movePos.top + ",【fistPos】left" + fistPos.left + "top" + fistPos.top + ",  【tarPos】left" + tarPos.left + "top" + tarPos.top);
                            //$(this).text("X:" + $tarIcon.offset().left + "Y:" + $tarIcon.offset().top);
                        });
                    }).mouseup(function () {
                        if (!isDrag) return false;
                        $(".moveIcon").insertBefore($("#tempIcon")); // 拖拽对象插入到 占位对象的位置上 
                        $(".moveIcon").removeClass("moveIcon").css({ "opacity": 1 }); //恢复对象的初始样式 
                        $("#tempIcon").remove(); // 删除占位对象

                        isDrag = false;
                    });
                };

                function stopDrag() {
                    $(document).unbind("mousemove").unbind("mouseup");
                };
            }

            /// <summary>
            /// 初始化 变更提醒
            /// </summary>
            function initBGTip() {
                $.post("/Home/GetBGTip", {}, function (json) {
                    var html = "";
                    if (json != null) {
                        if (json.ChangeApply > 0)
                            html += "<li><a href='/WFCheck/ChangeApply/ChangeApplyList' rel='WFCheck.ChangeApply' title='变更申请'>您有<b>" + json.ChangeApply + "</b>条 变更申请 等待处理</a></li>";
                        if (json.ChangeInfoByYZ > 0)
                            html += "<li><a href='/WFCheck/ChangeInfo/Index' rel='WFCheck.ChangeInfo.Index' title='变更通知'>您有<b>" + json.ChangeInfoByYZ + "</b>条 变更通知 等待处理</a></li>";
                        if (json.ChangeInfoByJL > 0)
                            html += "<li><a href='/WFCheck/ChangeInfo/VisionIndex' rel='WFCheck.ChangeInfo.VisionIndex' title='变更通知浏览'>您有<b>" + json.ChangeInfoByJL + "</b>条 变更通知 等待处理</a></li>";
                        if (json.ChangeOrder > 0)
                            html += "<li><a href='/WFCheck/ChangOrder/Index' rel='WFCheck.ChangOrder.Index' title='变更令'>您有<b>" + json.ChangeOrder + "</b>条 变更令 等待处理</a></li>";
                    }
                    if (html == "") html = "暂无待办变更！"
                    $("#Home_Index_BGTip").html(html);

                    $("#Home_Index_BGTip a").click(function (e) {
                        var $this = $(this);
                        var title = $this.attr("title") || $this.text();
                        var tabid = $this.attr("rel") || "_blank";
                        var fresh = eval($this.attr("fresh") || "true");
                        var external = eval($this.attr("external") || "false");
                        var url = $this.attr("href");
                        DWZ.debug(url);
                        if (!url.isFinishedTm()) {
                            alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
                            return false;
                        }
                        navTab.openTab(tabid, url, { title: title, fresh: fresh, external: external });
                        e.preventDefault();
                    });
                }, "json");
            }
        }

        $(document).ready(function () {
            new Home().init();
            Tracking(1);
            $("#TrakList").height(windowH - 397);
        });
        function Tracking(ID) {
            $("#TrakList").html("").load("/Home/TrackingList?ID=" + ID);
        }
        function kuaijie() {
            var aa = document.getElementById("kuaijie").style.display;
           
            if (aa=="none") {
                document.getElementById("kuaijie").style.display = "block";
            } if (aa=="block") {
                document.getElementById("kuaijie").style.display = "none";
            }
            
        }
    </script>
    <style type="text/css">
      /*start*/
        .transparent100 {
            filter: alpha(opacity=100);
            -moz-opacity: 1;
            -khtml-opacity: 1;
            opacity: 1;
        }

        .transparent80 {
            filter: alpha(opacity=80);
            -moz-opacity: 0.8;
            -khtml-opacity: 0.8;
            opacity: 0.8;
        }

            .transparent80 input {
                vertical-align: middle;
            }

        .rsbHeader ul,
        .rsbListItem ul {
            margin: 0;
            padding: 0;
            width: 100%;
            display: inline-block;
            list-style-type: none;
        }

        .rsbHeader ul {
            padding-left: 5px;
        }

        .col1,
        .col2,
        .col3 {
            margin: 0;
            padding: 0 5px 0 0;
            width: 100%;
            line-height: 14px;
            float: left;
        }

        .hide {
            display: none;
        }

        .table {
            border: 1px solid #ccc;
            width: 100%;
            background-color: white;
        }

        .tablebar {
            font-family: verdana,arial,sans-serif;
            font-size: 11px;
            color: #333333;
            border-width: 1px;
            border-color: #ccc;
            border-collapse: collapse;
        }

            .tablebar td {
                cursor: pointer;
                border-width: 1px;
                padding: 7px;
                border-style: solid;
                border-color: #ccc;
                background-color: #ffffff;
            }

        .gridtable {
            font-family: verdana,arial,sans-serif;
            font-size: 11px;
            color: #333333;
            border-width: 1px;
            border-color: #666666;
            border-collapse: collapse;
        }

            .gridtable tr {
                height: 13px;
                line-height: 13px;
            }

            .gridtable th {
                border-width: 1px;
                padding: 8px;
                border-style: solid;
                border-color: #666666;
                background-color: #dedede;
            }

            .gridtable td {
                border-width: 1px;
                padding: 8px;
                border-style: solid;
                border-color: #666666;
                background-color: #ffffff;
            }

        .noBorderTable {
            border-collapse: collapse;
            border: 0px solid #999;
        }

            .noBorderTable td {
                border-top: 0;
                border-right: 1px solid #999;
                border-bottom: 1px solid #999;
                border-left: 0;
            }

            .noBorderTable tr.lastrow td {
                border-bottom: 0;
            }

            .noBorderTable tr td.lastCol {
                border-right: 0;
            }

        .topbord {
            border-top: 1px solid #999;
        }

        .messtable {
            border-collapse: collapse;
            border: 0px solid #999;
        }

        .linktable {
            margin-left: 20px;
            border-collapse: collapse;
            border: 0px solid #999;
        }

            .linktable td {
                border: 0;
            }

        .left {
            text-align: left;
            padding-top: 2px !important;
            padding-right: 19px !important;
            padding-bottom: 2px !important;
            padding-left: 2px !important;
        }

        .right {
            text-align: right;
            padding: 2px !important;
        }

        table.popupHead {
            font-family: verdana,arial,sans-serif;
            font-size: 11px;
            color: #333333;
            border-width: 1px;
            border-color: #666666;
        }

            table.popupHead th {
                border-width: 1px;
                padding: 7px;
                border-style: solid;
                border-color: #666666;
                background-color: #dedede;
            }

        #popupDiv {
            border-width: 1px;
            border-style: solid;
            border-color: #666666;
            width: 715px;
            height: 297px;
            position: absolute;
            z-index: 10000;
            background-color: #e2efff;
            top: 14%;
            left: 25%;
        }

        #stationList tr {
            text-align: center;
        }

            #stationList tr:hover {
                background: #e2efff;
            }

                #stationList tr:hover td {
                    background: none;
                }

        .MapLable {
            border-width: 1px;
            border-style: solid;
            border-color: #666666;
            background-color: #e2efff;
            position: absolute;
            display: block;
            z-index: 10;
           @* bottom: 10px;*@
            left: 15px;
            
        }
        .MapLableTotal {
            border-width: 1px;
            border-style: solid;
            border-color: #666666;
            background-color: #e2efff;
            position: absolute;
            display: block;
            z-index: 10;
            @*bottom: 10px;*@
            right: 15px;
            
        }
        .maximize {
            display: none;
        }

        .actionList {
            display: none;
        }

        #districNav {
            line-height: 27px;
            font-size: 13px;
            font-weight: 700;
        }

            #districNav span {
                cursor: pointer;
            }

        .red {
            color: red;
        }

        .yellow {
            color: orange;
        }

        .gray {
            color: gray;
        }

        .green {
            color: green;
        }

        #mapNameDiv {
            position: absolute;
            margin-top: 7px;
            margin-left: 20px;
            z-index: 1000000;
            text-align: center;
            color: black;
            font-weight: bold;
        }

        .messtable tr td:first-child {
            line-height: 0;
            height: 17px;
            text-align: justify;
            text-justify: inter-ideograph;
            text-align-last: justify; /* ie9*/
            -moz-text-align-last: justify; /*ff*/
            -webkit-text-align-last: justify; /*chrome 20+*/
        }

  

        #stateList tr {
            line-height: 11px;
        }
          /*end*/
         .table_user
        {
            margin: 2px;
            padding: 2px;
        }
        .table_user td
        {
            margin: 2px;
            height: 25px;
            line-height: 25px;
            border: 0;
            border-bottom: 1px dotted #CCCCCC;
        }
        #mainContent_Home_Index
        {
            padding: 0 5px;
        }
        #mainContent_Home_Index .l_bt span
        {
            float: left;
            line-height: 26px;
        }
        #mainContent_Home_Index .l_bt a
        {
            float: right;
            width: 50px;
            line-height: 26px;
        }
        #mainContent_Home_Index .l_bt .more
        {
            background: url(/Content/icon/Index/more_001.gif) no-repeat;
            text-indent: -10000px;
        }
        /*快捷操作*/
        .fast_bar
        {
            padding: 10px;
        }
        .fast_bar ul
        {
            width: 100%;
            min-height: 100px;
            margin-bottom: 0;
        }
        .fast_bar li
        {
            float: left;
            display: block;
            width: 90px;
            height: 90px;
            padding: 5px;
            text-align: center;
        }
        .fast_bar li img
        {
            border: 0;
            margin-top: 10px;
        }
        .fast_bar .a_icon
        {
            display: block;
            width: 90px;
            height: 90px;
            color: #333;
            text-decoration: none;
            line-height: 20px;
            border: 1px solid #fff;
            overflow: hidden;
            text-align: center;
            background: #fff;
        }
        .fast_bar .a_icon:hover
        {
            border: 1px solid #bbb;
        }
        .fast_bar .a_icon_edit
        {
            border: 1px dashed #666;
        }
        .fast_bar .a_icon_edit:hover
        {
            border: 1px dashed #666;
        }
        .fast_bar .btn_bar
        {
            line-height: 20px;
            height: 20px;
            display: none;
            position: relative;
            top: -90px;
            background: #ccc;
            opacity: 0.5;
            filter: alpha(opacity=50);
        }
        .fast_bar .btn_bar .btn_edit
        {
        }
        .fast_bar .btn_bar .btn_del
        {
        }
        
        .fast_bar .li_add
        {
            display: none;
        }
        .moveIcon
        {
            position: absolute;
            z-index: 1000;
        }
        /*代办变更*/
        #Home_Index_BGTip
        {
            height: 100px;
        }
        #Home_Index_BGTip a
        {
            font-weight: normal;
            color: #000;
        }
        .measureTrack
        {
            float: right;
            width: 40%;
        }
        .measureTrack ~ .workContainer
        {
            @*float: left;*@ 
            max-width: 60%; 
            padding-right: 520px; 
            @*--box-sizing: border-box;
            -moz-box-sizing: border-box;*@
        }
        .measureTrack ~ .workContainer .panel{
            margin-right:10px;
        }
    </style>
}
<div class="page" layouth="0" style="position: relative">
    <div id="mainContent_Home_Index">
        <div class="panel mt10" id="kuaijie" style="display: none">
            <h1>
                <span class="pull-right"><a href="javascript:void(0);" id="backBtn_Home_Index" class="hide"
                    title="取消">取消</a> <a href="javascript:void(0);" id="saveBtn_Home_Index" class="hide"
                        title="保存">保存</a> <a href="javascript:void(0);" id="manageBtn_Home_Index" title="管理">管理</a></span>快捷操作</h1>
            <div>
                <div class="p99">
                    <div class="fast_bar cf">
                        <ul>
                            @foreach (var entity in ViewBag.FastBarList as List<DotNet.Model.BaseModuleEntity>)
                            {
                                <li><a class="a_icon"  target="_navTab" rel="@entity.Code" href="javascript:void(0);" url="@entity.NavigateUrl" moduleId="@entity.Id">
                                    <img src="@entity.ImageUrl">
                                    <br />
                                    <span>@entity.FullName</span></a>
                                    <div class="btn_bar">
                                        <a class="btn_edit" href="javascript:void(0);">替换</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <a class="btn_del" href="javascript:void(0);">删除</a>
                                    </div>
                                </li>
                            }
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        @* //start*@
        <script type="text/javascript">
            Date.prototype.Format = function (fmt) {
                var o = {
                    "M+": this.getMonth() + 1, //月份 
                    "d+": this.getDate(), //日 
                    "h+": this.getHours(), //小时 
                    "m+": this.getMinutes(), //分 
                    "s+": this.getSeconds(), //秒 
                    "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
                    "S": this.getMilliseconds() //毫秒 
                };
                if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
                for (var k in o)
                    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) :
                        (("00" + o[k]).substr(("" + o[k]).length)));
                return fmt;
            }



            dojo.require("dijit.layout.BorderContainer");
            dojo.require("dijit.layout.ContentPane");
            dojo.require("esri.map");
            dojo.require("esri.layers.agstiled");
            dojo.require("esri.toolbars.draw");
            dojo.require("esri.undoManager");
            dojo.require("esri.tasks.geometry");
            dojo.require("esri.symbols.Font");
            dojo.require("esri.dijit.Scalebar");
            dojo.require("esri.layers.FeatureLayer");
            dojo.require("dojox.charting.Chart2D");
            dojo.require("dojox.charting.plot2d.Pie");
            dojo.require("dojox.charting.action2d.Highlight");
            dojo.require("dojox.charting.action2d.MoveSlice");
            dojo.require("dojox.charting.action2d.Tooltip");
            dojo.require("dojo.number"); 
            dojo.require("dijit.layout.TabContainer");
            dojo.require("esri.toolbars.navigation");
            dojo.require("esri.dijit.BasemapLayer");
         
            var map = null;
            var navToolbar = null;
            var graphicLayer = null;
            var equipClickHandler = null;
            var equipMouseOverHandler = null;
            var equipMouseOutHandler = null;
            var equipDbClickHandler = null;
            //自动雨量监测站
            var layer10001000 = null;
            var layer10001001 = null;
            //自动水位监测站
            var layer10001010 = null;
            var layer10001011 = null;
           

            var cityGraphicLayer = null;
            var see = 900000;
            //初始化地图
            function init() {

                DivCreated();
                //引用并实例地图
                map = new esri.Map("mapDiv", {
                    zoom: 5,
                    nav: false,//8个pan 箭头
                    slider: false,//左上的缩放 +/-;
                    sliderStyle: "large",
                    logo: false,//右下的esri logo
                    showAttribution: false,//右下的gisNeu (logo左侧)
                    displayGraphicsOnPan: false//false 设置地图上的图形在移动时是否显示
                });
                //不在测试服务器是否支持跨越请求
                esri.config.defaults.io.corsDetection = false;
                //map.addEventListener(MapMouseEvent.MAP_CLICK, mapRouteCkHandler);
                $.ajax({
                    url: "XMLArcgis.xml",
                    dataType: 'xml',
                    type: 'GET',
                    timeout: 2000,
                    error: function (xml) {
                        alert("加载地图文件出错！");
                    },
                    success: function (xml) {
                        var distric = "200000215";
                        $(xml).find("distric[id='" + distric + "']").each(function (i) {
                            var url = $(this).children("url").text();
                            var medthod = $(this).children("medthod").text();
                            var layer = $(this).children("layer").text();
                            var zoom1 = $(this).children("zoom1").text();
                            var zoom2 = $(this).children("zoom2").text();
                            var zoom3 = $(this).children("zoom3").text();
                            var zoom4 = $(this).children("zoom4").text();
                            var scale1 = $(this).children("scale1").text();
                            var scale2 = $(this).children("scale2").text();
                            var scale3 = $(this).children("scale3").text();
                            var scale4 = $(this).children("scale4").text();
                            var BaseMap = null;
                            var ServiceLayer = null;
                            if (i == 0) {
                                $("#RadTextBoxMethod").val(medthod);
                                $("#RadTextBoxScale1").val(scale1);
                                $("#RadTextBoxScale2").val(scale2);
                                $("#RadTextBoxScale3").val(scale3);
                                $("#RadTextBoxScale4").val(scale4);
                                $("#RadTextBoxZoom1").val(zoom1);
                                $("#RadTextBoxZoom2").val(zoom2);
                                $("#RadTextBoxZoom3").val(zoom3);
                                $("#RadTextBoxZoom4").val(zoom4);
                            }
                            if (medthod == "Dynamic") {
                                ServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(url);
                                if (layer != "")
                                    ServiceLayer.setVisibleLayers([layer]);
                                map.addLayer(ServiceLayer);
                                navToolbar = new esri.toolbars.Navigation(map);
                            }
                            if (medthod == "Tiled") {
                                ServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer(url);
                                map.addLayer(ServiceLayer);
                                navToolbar = new esri.toolbars.Navigation(map);
                            }
                            //navToolbar.zoomToFullExtent();
                        });
                        map.infoWindow.resize(3000, 1800);
                        //dojo.connect(map, "onMouseWheel", function (evt) {
                        //$("#DivLayerShow").hide();
                        //    if( parseFloat(see)>parseFloat(map.getScale()))
                        //        alert(map.getScale());
                        //});
                        //获取并设定地图中点及地图范围
                        GetCenter(distric, 1);
                        //setInterval(GetStation, 6000000);
                    }
                });
            }
            function GetStation() {
                map.infoWindow.hide();
                //关闭弹出框
                divClose();
                ////获取行政区划导航
                //GetNav();
                ////刷新汇总信息
                //GetStationCountList();
                //获取监测设备信息
                GetPoint();
            }
            //获取并设定地图中点及地图范围
            function GetCenter(distric, get) {
                map.infoWindow.hide();
                distric = $("#districcenterTextBox").val();
                if (distric) {
                    if (get == 1)
                        $("#RadTextBoxDistric").val(distric);
                }
                else
                    distric = $("#RadTextBoxDistric").val();
                $.ajax({
                    url: "XMLArcgis.xml",
                    dataType: 'xml',
                    type: 'GET',
                    timeout: 2000,
                    success: function (xml) {
                        $(xml).find("distric[id='" + distric + "center']").each(function (i) {
                            var x = $(this).children("x").text();
                            var y = $(this).children("y").text();
                            var level = $(this).children("level").text();
                            if ($("#RadTextBoxMethod").val() == "Tiled") {
                                var zoom = null;
                                if (level == 1)
                                    zoom = $("#RadTextBoxZoom1").val();
                                if (level == 2)
                                    zoom = $("#RadTextBoxZoom2").val();
                                if (level == 3)
                                    zoom = $("#RadTextBoxZoom3").val();
                                SetCenter(x, y, zoom, get);
                            }
                            else {
                                var scale = null;
                                if (level == 1)
                                    scale = $("#RadTextBoxScale1").val();
                                if (level == 2)
                                    scale = $("#RadTextBoxScale2").val();
                                if (level == 3)
                                    scale = $("#RadTextBoxScale3").val();
                                var divHeight = document.documentElement.clientHeight;
                                var constHeight = 554;
                                var di = divHeight - constHeight;
                                var x1 = di * 550;
                                scale = (scale - x1);
                                SetCenter(x, y, scale, get);
                            }
                        });
                    }
                });
            }
            //设定地图中点及地图范围
            function SetCenter(x, y, z, get) {
                //实例化点
                var point = newPoint(x, y);
                //设置地图中心点经纬度、图层以及地图级别
                if ($("#RadTextBoxMethod").val() == "Tiled")
                    map.setZoom(z);
                else
                    map.setScale(z);
                map.centerAt(point);
                if (get == 1) {
                    //添加设备图层
                    GetStation();
                }
            }
            //获取并标注城市点
            function GetCity() {
              
                if (cityGraphicLayer != null) {
                    cityGraphicLayer.clear();
                }
                var distric = $("#RadTextBoxDistric").val();
                var type = "1";
                $('input[name="checkboxType"]:checked').each(function () {
                    type += "'" + $(this).val() + "',";
                });
                type = type.substring(0, type.length - 1);
                $.ajax({
                    type: "post",
                    url: "/Home/Test",
                    data: { get: "6", Distric: distric, Type: type },
                    success: function (data) {
                       
                        data = eval(data);
                        var count = data.length;
                        for (var i = 0; i < count; i++) {
                            if (data[i].Longitude && data[i].Latitude)
                                addCityPoint(data[i]);
                        }
                    },
                    error: function () {
                       
                    }
                });
            }
            //标注城市点
            function addCityPoint(data) {
                
                if (data.Longitude != "" && data.Latitude != "") {
                    if (cityGraphicLayer == null) {
                        cityGraphicLayer = new esri.layers.GraphicsLayer();
                        ////设置比例尺 setScaleRange(minScale,maxScale);  
                        ////minScale - 最小比例尺 - 再远就看不见；minScale设置为0，则在无穷远也显示
                        ////maxScale - 最大比例尺 - 再近就看不见；maxScale设置为0，则在无穷近也显示
                        //cityGraphicLayer.setScaleRange(0, see);
                        map.addLayer(cityGraphicLayer);
                    }
                    //要标注的坐标点及图层
                    var point = newPoint(data.Longitude, data.Latitude);
                    //设置标注显示的图标
                    var imagesize = 10;
                    var imag = "red.gif";
                    if (data.AllY == 0)
                        imag = "green.gif";
                    if (data.RoadType == "300") {
                        imagesize = 8;
                        imag = "red.png";
                        if (data.AllY == 0)
                            imag = "green.gif";
                    }
                    var symbol = new esri.symbol.PictureMarkerSymbol(imag, imagesize, imagesize);
                    //创建模版
                    var attributes = {
                        "id": data.Id,
                        "name": data.Name,
                        "mess": data.Mess,
                        "ally": data.AllY,
                        "allz": data.AllZ,
                        "all": data.All,
                        "roadType": data.RoadType
                    };
                    //创建图像
                    var graphic = new esri.Graphic(point, symbol, attributes, null);
                    //把图像添加到刚才创建的图层上
                    cityGraphicLayer.add(graphic);
                    if (equipMouseOverHandler == null) {
                        equipMouseOverHandler = dojo.connect(cityGraphicLayer, "onMouseOver", function (evt) {
                            var obj = evt.graphic.attributes;
                            map.infoWindow.resize(200, 130);
                            map.infoWindow.setTitle(obj.name);
                            var shebei = "设备";
                            //if (obj.roadType == "300")
                            //    shebei = "设备";
                           
                            var infoMess = "<div style='line-height: 20px;color:blue;cursor: pointer;' onclick=\"GetCenter('" + obj.id + "',0)\">[" + obj.name + "]" + shebei + "状态信息</div>"
                             + "<div style='line-height: 20px;'>异常" + shebei + ":<span style='" + (parseInt(obj.ally) > 0 ? "color:red;" : "") + "'>" + obj.ally + "</span></div><div style='line-height: 20px;'>正常" + shebei + ":" + obj.allz + "</div>"
                             + "<div style='line-height: 20px;'>" + shebei + "总数:" + obj.all + "</div>";//"<div style='line-height: 20px;font-size:2px;color:red;'>注:单击查看详情，双击缩放至" + obj.name + "</div>";
                            map.infoWindow.setContent(infoMess);
                            //x方向偏小
                            map.infoWindow.show(map.toScreen(evt.mapPoint));
                        });
                    }
                    if (equipMouseOutHandler == null) {
                        equipMouseOutHandler = dojo.connect(cityGraphicLayer, "onMouseOut", function (evt) {
                            map.infoWindow.resize(300, 180);
                            map.infoWindow.hide(map.toScreen(evt.mapPoint));
                        });
                    }
                    //var TimeFn = null;
                    //if (equipClickHandler == null) {
                    //    equipClickHandler = dojo.connect(cityGraphicLayer, "onClick", function (evt) {
                    //        var obj = evt.graphic.attributes;
                    //        // 取消上次延时未执行的方法 
                    //        clearTimeout(TimeFn);
                    //        TimeFn = setTimeout(function () { countyDetails(obj) }, 300);
                    //    });
                    //}
                    //if (equipDbClickHandler == null) {
                    //    equipDbClickHandler = dojo.connect(cityGraphicLayer, "onDblClick", function (evt) {
                    //        var obj = evt.graphic.attributes;
                    //        // 取消上次延时未执行的方法 
                    //        clearTimeout(TimeFn);
                    //        GetCenter(obj.id, 0);
                    //        //location.href = "Home.aspx?Distric=" + obj.id;
                    //    });
                    //}
                }
            }
            //弹出地市详情
            function countyDetails(data) {
                if (data.roadType == "300") {
                    map.infoWindow.hide();
                    if (data.roadType == "300") {
                        $("#popupDiv").width(300);
                        $("#popupDiv").height(315);
                    } else {
                        $("#popupDiv").width(250);
                        $("#popupDiv").height(115);
                    }
                    $("#divThead").height(25);
                    $("#stationHead").html("");
                    $("#stationList").html("");
                    $("#banner").html(data.name);
                    var shebe = "服务器信息";
                    if (data.roadType == "300")
                        shebe = "设备汇总信息";
                    var infoMess = "<div style='line-height: 20px;color:blue;cursor: pointer;' title='跳转至" + data.name + "' onclick=\"Href('" + data.id + "')\">[" + data.name + "]" + shebe + "：</div>";
                    $("#stationHead").html(infoMess);
                    $("#stationList").html(data.mess);
                    $("#popupDiv").show();
                } else {
                    if (data.ally > 0)
                        divPopup(data.id, '1-1-0-0-0-1-self', data.name + '服务器异常设备列表', 0, '1');
                }
            }
            function Href(id) {
                location.href = "Home.aspx?Distric=" + id;
            }
            //获取并标注点
            function GetPoint() {
                //获取各地市异常设备数量
                GetCity();
                
                //设置图层显隐
               // SetLaye();
                //循环获取各类设备信息
                var distric = "";
                var type = "";
                distric = $("#RadTextBoxDistric").val();
               
                    GetTypePoint(distric, type, 0);
                   
            }
            function GetTypePoint(distric, type, state) {
                
                $.ajax({
                    type: "post",
                    url: "Home/Test",
                    //async: false,
                    data: { get: "8", Distric: distric, Type: type},
                    success: function (data) {
                       
                        data = eval(data);
                        var count = data.length;
                        var i = 0;
                        while (i < count) {
                            if (data[i].Longitude && data[i].Latitude)
                                addPoint(i, data[i], type, state);
                            i++;
                        }
                    },
                    error: function () {
                   
                }
                });
            }
            //标注点
            function addPoint(i, data, type, state) {
                //要标注的坐标点及图层
               
                var point = newPoint(data.Longitude, data.Latitude);
                var pstate = data.State;
                //设置标注显示的图标
                var imagesize = 10;
                var imag = "red.gif";
                if (data.AllY == 0)
                    imag = "green.gif";
                var symbol = new esri.symbol.PictureMarkerSymbol(imag, imagesize, imagesize);
              
                //创建模版
                var attributes = {
                    "id": data.Id,
                    "name": data.Name
                };
                //var infoTemplate = new esri.InfoTemplate();
                //infoTemplate.setTitle("设备类型:${typeName}");
                //infoTemplate.setContent(GetPointMess(data));
                //创建图像
                var graphic = new esri.Graphic(point, symbol, attributes, null);
                //把图像添加到刚才创建的图层上
                if (i==0) {
                    //dojo.connect(cityGraphicLayer, "onClick", function (evt) {

                    //    //   evt.graphic.setSymbol(symbol);
                    //    var obj = evt.graphic.attributes;

                    //    map.infoWindow.setTitle("收费站:" + obj.name);
                    //    map.infoWindow.setContent(GetPointMess(obj.id));
                    //    map.infoWindow.show(map.toScreen(evt.mapPoint));
                    //});
                }
               
            
            }
            function GetPointMess(id) {
               
                var infoMess = "";
                $.ajax({
                    type: "post",
                    url: "/Home/Test",
                    async: false,
                    data: { get: "9", Distric: id },
                    success: function (data) {
                        
                         infoMess = "<table id='message2" + data.Id + "' >";
                        infoMess += "<tr><td style='width:85px;'>站 点 名 称：</td><td>" + data.Name + "</td></tr>"
                        + "<tr><td>站 点 地 址：</td></tr></table>";
                    }
                });
                return infoMess;
            }
            function ShowTable(num, id) {
                if (num == 1) {
                    $("#taInfo1" + id).attr("style", "background-color: #F7F7F7");
                    $("#message1" + id).attr("style", "");
                    $("#taInfo2" + id).attr("style", "background-color: #white");
                    $("#message2" + id).attr("style", "display:none;");
                }
                if (num == 2) {
                    $("#taInfo1" + id).attr("style", "background-color: #white");
                    $("#message1" + id).attr("style", "display:none;");
                    $("#taInfo2" + id).attr("style", "background-color: #F7F7F7");
                    $("#message2" + id).attr("style", "");
                }
            }
            function GetAttri(id) {
                var attrInfo = "<table class='table' name='message2' style='display:none;'>";
                $.ajax({
                    type: "post",
                    async: false,
                    url: "/Home/Test",
                    data: { get: "5", Id: id },
                    success: function (data) {
                        data = eval(data);
                        var count = data.length;
                        for (var i = 0; i < count; i++) {
                            var info = data[i];
                            attrInfo += "<tr><td style='text-align:right;width:80px;'>" + info.AttriName + ":</td><td>" + info.Value + "</td></tr>"
                        }
                    }
                });
                attrInfo += "</table>";
                return attrInfo;
            }
            //实例化点
            function newPoint(x, y) {
                //根据经纬度标注
                var point = new esri.geometry.Point({
                    "x": x,
                    "y": y
                });
                //根据墨卡托标注
                //point = esri.geometry.geographicToWebMercator(point);
                return point;
            }
            //加载地图
            dojo.addOnLoad(init);

            //设置地图div宽高
            function DivCreated() {
                var divHeight = document.documentElement.clientHeight;
                var divWidth = document.documentElement.clientWidth;

                $("#mapDiv").height(divHeight - 160);
                $("#mapDiv").width(divWidth - 220);
                // $("#mapDiv").width(divWidth - 284);
                //$("#leftDiv").height(divHeight - 4);
                //$("#leftDiv").width(280);
                //$("#stateList").height(divHeight - 55);
            }
            //获取设备状态统计表
            function GetStationCountList() {
                var distric = $("#RadTextBoxDistric").val();
                $.ajax({
                    type: "post",
                    url: "/Home/Test",
                    data: { get: "3", Distric: distric },
                    success: function (data) {
                        $("#StationCountList").html(data);
                    }
                });
            }
            //获取行政区划导航
            function GetNav() {

                var distric = $("#RadTextBoxDistric").val();
                $.ajax({
                    type: "post",
                    async: false,
                    url: "/Home/Test",
                    data: { get: "4", Distric: distric },
                    success: function (data) {
                        $("#districNav").html(data);
                    }
                });
                var rtype = $("#textRType").val();
                if (rtype == "300")
                    $("#cityImage").attr("style", "display:none");
                $("#mapNameDiv").html($("#mapName").html());
            }

            //点击lable后 选中/去掉选中 checkbox
            function checkedBox(value) {
                var obj = $("input[type='checkbox'][value = '" + value + "']");
                if (obj.prop("checked")) {
                    obj.prop("checked", false);
                }
                else {
                    obj.prop("checked", true);
                }
                //根据选择控制图层显隐
                SetLaye();
            }
            function choseCheckBox(i) {
                if (i == 0) {
                    //全选
                    $("#tabletype input[type='checkbox']").prop("checked", true);
                }
                if (i == 1) {
                    //反选
                    $("#tabletype input[type='checkbox']").each(function () {
                        if ($(this).prop("checked")) {
                            $(this).prop("checked", false);
                        }
                        else {
                            $(this).prop("checked", true);
                        }
                    })
                }
                SetLaye();
            }
            //弹出设备状态列表
            function divPopup(distric, type, name, state, ftype) {
                map.infoWindow.hide();
                $("#stationHead").html("");
                $("#stationList").html("");
                $("#banner").html(name);
                $("#divThead").height(36)
                $("#popupDiv").width(790);
                $("#popupDiv").height(318);
                $.ajax({
                    type: "post",
                    url: "/Home/Test",
                    async: false,
                    data: { get: "7", Distric: distric, Type: "'" + type + "'", State: state, FType: ftype },
                    success: function (data) {
                        var thead = "<thead><tr style='text-align: center; font-weight: 800;'><td style='width: 30px;'>序号</td>";
                        if (type == "1-1-0-0-1-0-") {
                            //$("#popupDiv").width(835);
                            //thead += "<td style='width: 60px;'>所在乡镇</td><td style='width: 60px;'>所在村庄</td>";
                            $("#popupDiv").width(775);
                            thead += "<td style='width: 60px;'>行政区划</td>";
                            thead += "<td style='width: 70px;'>站点名称</td>"
                                + "<td style='width: 65px;'>站点编号</td><td style='width: 75px;'>故障信息</td><td style='width: 60px;'>故障级别</td>"
                                + "<td style='width: 120px;'>故障发生时间</td><td style='width: 120px;'>故障处置状态</td></tr></thead>";
                        } else {
                            thead += "<td style='width: 60px;'>行政区划</td>";
                            if (ftype == "")
                                thead += "<td style='width: 100px;'>设备类型</td><td style='width: 100px;'>设备名称</td>";
                            else if (ftype == 1 || ftype == 4)
                                thead += "<td style='width: 100px;'>服务器名称</td>";
                            else
                                thead += "<td style='width: 100px;'>站点名称</td>";
                            if (ftype == 4) {
                                thead += "<td style='width: 210px;'>故障信息</td>";
                            } else {
                                thead += "<td style='width: 130px;'>故障信息</td><td style='width: 60px;'>故障级别</td>";
                            }
                            thead += "<td style='width: 120px;'>故障发生时间</td>";
                            if (ftype == "")
                                thead += "<td style='width: 150px;'>设备位置</td>";
                            else if (ftype == 1 || ftype == 4)
                                thead += "<td style='width: 150px;'>服务器位置</td></tr></thead>";
                            else
                                thead += "<td style='width: 150px;'>站点位置</td></tr></thead>";
                        }
                        var tbody = "";
                        data = eval(data);
                        var count = data.length;
                        for (var i = 0; i < count; i++) {
                            var stateColor = "gray";
                            var state = data[i].State;
                            var stateMes = data[i].FaultDesc;//.StateMessage
                            if (data[i].CompType == "1-1-0-0-0-1-") {
                                stateMes = data[i].StateMessage;
                            }
                            var name = data[i].Name;
                            if (ftype == "4" || ftype == "1") {
                                name = data[i].CompName;
                            }
                            var time = "";
                            if (ftype == "" || ftype == "2" || ftype == "3" || type == "1-1-0-0-0-1-0-") {
                                time = data[i].AlarmDate;
                            }
                            var leve = data[i].AlarmLevel;
                            if (leve == null) {
                                leve = "";
                            }
                            if (state == "0")
                                stateColor = "red";
                            if (state == "1")
                                stateColor = "yellow";
                            if (state == "2")
                                stateColor = "gray";
                            if (state == "3")
                                stateColor = "green";

                            if (data[i].Type == "1-1-0-0-1-9-" || data[i].Type == "1-1-0-0-1-10-" || data[i].Type == "1-1-0-0-1-11-" || data[i].Type == "1-1-0-0-1-12-") {
                                time = data[i].OccurDate;
                                leve = data[i].FaultProperty;;
                                stateMes = data[i].FaultDesc;
                                if (leve == "一级故障")
                                    stateColor = "red";
                                if (leve == "二级故障")
                                    stateColor = "yellow";
                            }
                            if (type == "1-1-0-0-1-0-") {
                                //自动雨量站
                                var bstate = data[i].BillStatus;
                                var bcolor = "";
                                if (bstate == "未上报")
                                    bcolor = "red";
                                if (bstate == "未处理")
                                    bcolor = "yellow";
                                if (bstate == "处理中")
                                    bcolor = "green";
                                tbody += "<tr onclick='ShowTr($(this)," + data[i].Id + ",0)'>";
                                tbody += "<td style='width: 30px;text-align:center;'>" + parseInt(parseInt(i) + 1) + "</td>"
                                   // + "<td style='width: 60px;'>" + data[i].TownshipADNM + "</td><td style='width: 60px;'>" + data[i].VillageADNM + "</td>"
                                    + "<td style='width: 60px;'>" + data[i].DistricName + "</td>"
                                    + "<td style='width: 70px;'>" + name + "</td>"
                                    + "<td style='width: 65px;'>" + data[i].Code + "</td><td style='width: 75px;' class='" + stateColor + "'>" + stateMes + "</td>"
                                    + "<td style='width: 60px;'>" + leve + "</td><td style='width: 120px;'>" + time + "</td><td style='width: 120px;' class='" + bcolor + "'>" + bstate + "</td></tr>";
                                //隐藏的联系人信息
                                tbody += "<tr style='display:none;' rowspan='3' id='" + data[i].Id + "'><td colspan='8'><table class='linktable'>"
                                  + "<tr><td class='right'>管护人员:</td><td class='left'>" + data[i].LinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].LinkManDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].LinkPhone + "</td></tr>"
                                  + "<tr class='topbord'><td  class='right'>乡级管理单位:</td><td class='left'>" + data[i].AdminUnit + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AdminLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AdminLinkManDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AdminLinkPhone + "</td></tr>"
                                  + "<tr class='topbord'><td class='right'>县级管理单位:</td><td class='left'>" + data[i].Admauth + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AtcunitDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AtcunitDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AtcunitDutyLinkPhone + "</td></tr>"
                                  + "<tr class='topbord'><td class='right'>维修单位:</td><td class='left'>" + data[i].MaintainCorp + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].MaintainCorpDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].MaintainCorpDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].MaintainCorpDutyLinkPhone + "</td></tr>"
                                  + "</table></td></tr>";

                            } else {
                                if (ftype == "4" || ftype == "1")
                                    tbody += "<tr onclick='ShowTr($(this)," + data[i].EquipmentId + ",0)'>";
                                else
                                    tbody += "<tr onclick='ShowTr($(this)," + data[i].Id + ",0)'>";
                                tbody += "<td style='width: 30px;text-align:center;'>" + parseInt(parseInt(i) + 1) + "</td>";
                                tbody += "<td style='width: 60px;'>" + data[i].DistricName + "</td>";
                                if (ftype == "")
                                    tbody += "<td style='width: 100px;'>" + data[i].TypeName + "</td>";
                                tbody += "<td style='width: 100px;'>" + name + "</td>";
                                if (ftype == "4") {
                                    tbody += "<td style='width: 363px;padding: 0px;' colspan='3'>" + stateMes + "</td><td style='width: 150px;'>" + data[i].Addr + "</td></tr>"
                                }
                                else if (type == "1-1-0-0-0-1-6-" || type == "1-1-0-0-0-1-" || type == "1-1-0-0-0-1-self")
                                    tbody += "<td style='width: 360px;padding: 0px;' colspan='3'>" + stateMes + "</td><td style='width: 150px;'>" + data[i].Addr + "</td></tr>"
                                else {
                                    tbody += "<td style='width: 130px;' class='" + stateColor + "'>" + stateMes + "</td>"
                                    tbody += "<td style='width: 60px;'>" + leve + "</td><td style='width: 120px;'>" + time + "</td><td style='width: 150px;'>" + data[i].Addr + "</td></tr>";
                                }
                                //隐藏的联系人信息
                                if (ftype == "4" || ftype == "1") {
                                    tbody += "<tr style='display:none;' rowspan='3' id='" + data[i].EquipmentId + "'><td colspan='7'><table class='linktable'>"
                                        + "<tr><td class='left' colspan='7'>服务器IP地址:" + data[i].IpValue + "</td></tr>"
                                        + "<tr><td class='left' colspan='7'>服务器运行内容:" + data[i].CompRemark + "</td></tr>"
                                        + "<tr class='topbord'><td class='right'>管理单位:</td><td class='left'>" + data[i].Admauth + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AtcunitDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AtcunitDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AtcunitDutyLinkPhone + "</td></tr>"
                                        + "<tr class='topbord'><td class='right'>维修单位:</td><td class='left'>" + data[i].MaintainCorp + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].MaintainCorpDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].MaintainCorpDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].MaintainCorpDutyLinkPhone + "</td></tr>"
                                        + "</table></td></tr>";
                                }
                                else {
                                    tbody += "<tr style='display:none;' rowspan='3' id='" + data[i].Id + "'>";
                                    if (ftype == "")
                                        tbody += "<td colspan='8'>";
                                    else
                                        tbody += "<td colspan='7'>";
                                    tbody += "<table class='linktable'><tr><td class='right'>站点编号:</td><td class='left'>" + data[i].Code + "</td></tr>"
                                    + "<tr class='topbord'><td  class='right'>管护人员:</td><td class='left'>" + data[i].LinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].LinkManDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].LinkPhone + "</td></tr>"
                                    + "<tr class='topbord'><td  class='right'>乡级管理单位:</td><td class='left'>" + data[i].AdminUnit + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AdminLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AdminLinkManDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AdminLinkPhone + "</td></tr>"
                                    + "<tr class='topbord'><td class='right'>县级管理单位:</td><td class='left'>" + data[i].Admauth + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AtcunitDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AtcunitDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AtcunitDutyLinkPhone + "</td></tr>"
                                    + "<tr class='topbord'><td class='right'>维修单位:</td><td class='left'>" + data[i].MaintainCorp + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].MaintainCorpDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].MaintainCorpDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].MaintainCorpDutyLinkPhone + "</td></tr>"
                                    + "</table></td></tr>";

                                }
                            }
                        }
                        if (ftype == "") {
                            $("#popupDiv").width(906);
                            tbody += CompDivPopup(distric, count);
                        }
                        $("#stationHead").html(thead);
                        $("#stationList").html("<tbody>" + tbody + "</tbody>");
                    }
                });
                $("#popupDiv").show();
            }
            //弹出设备状态列表
            function divRenPopup(distric, type, name) {
                map.infoWindow.hide();
                $("#stationHead").html("");
                $("#stationList").html("");
                $("#banner").html(name);
                $("#divThead").height(36)
                $("#popupDiv").width(790);
                $("#popupDiv").height(318);
                $.ajax({
                    type: "post",
                    url: "/Home/Test",
                    async: false,
                    data: { get: "12", Distric: distric, Type: type },
                    success: function (data) {
                        var thead = "<thead><tr style='text-align: center; font-weight: 800;'><td style='width: 30px;'>序号</td>";
                        //$("#popupDiv").width(835);
                        //thead += "<td style='width: 60px;'>所在乡镇</td><td style='width: 60px;'>所在村庄</td>";
                        $("#popupDiv").width(775);
                        thead += "<td style='width: 60px;'>行政区划</td>";
                        thead += "<td style='width: 70px;'>站点名称</td>"
                            + "<td style='width: 65px;'>站点编号</td><td style='width: 75px;'>故障信息</td><td style='width: 60px;'>故障级别</td>"
                            + "<td style='width: 120px;'>故障发生时间</td><td style='width: 120px;'>故障处置状态</td></tr></thead>";
                        var tbody = "";
                        data = eval(data);
                        var count = data.length;
                        for (var i = 0; i < count; i++) {
                            var stateColor = "gray";
                            var state = data[i].FaultProperty;
                            var stateMes = data[i].FaultDesc;
                            var name = data[i].Name;
                            var time = data[i].OccurTime;
                            if (state == "一级故障")
                                stateColor = "red";
                            if (state == "二级故障")
                                stateColor = "yellow";
                            var bstate = data[i].BillStatus;
                            var bcolor = "";
                            if (bstate == "未上报")
                                bcolor = "red";
                            if (bstate == "未处理")
                                bcolor = "yellow";
                            if (bstate == "处理中")
                                bcolor = "green";
                            tbody += "<tr onclick='ShowTr($(this)," + data[i].Id + ",0)'>";
                            tbody += "<td style='width: 30px;text-align:center;'>" + parseInt(parseInt(i) + 1) + "</td>"
                               // + "<td style='width: 60px;'>" + data[i].TownshipADNM + "</td><td style='width: 60px;'>" + data[i].VillageADNM + "</td>"
                                + "<td style='width: 60px;'>" + data[i].DistricName + "</td>"
                                + "<td style='width: 70px;'>" + name + "</td>"
                                + "<td style='width: 65px;'>" + data[i].Code + "</td><td style='width: 75px;' class='" + stateColor + "'>" + stateMes + "</td>"
                                + "<td style='width: 60px;'>" + state + "</td><td style='width: 120px;'>" + time + "</td><td style='width: 120px;' class='" + bcolor + "'>" + bstate + "</td></tr>";
                            //隐藏的联系人信息
                            tbody += "<tr style='display:none;' rowspan='3' id='" + data[i].Id + "'><td colspan='8'><table class='linktable'>"
                                + "<tr><td class='right'>管护人员:</td><td class='left'>" + data[i].LinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].LinkManDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].LinkPhone + "</td></tr>"
                                //+ "<tr class='topbord'><td  class='right'>村级管理单位:</td><td class='left'>" + "" + "</td><td class='right'>负责人:</td><td class='left'>" + "" + "</td><td class='right'>职务:</td><td class='left'>" + "" + "</td><td class='right'>联系电话:</td><td class='left'>" + "" + "</td></tr>"
                                + "<tr class='topbord'><td  class='right'>乡级管理单位:</td><td class='left'>" + data[i].AdminUnit + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AdminLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AdminLinkManDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AdminLinkPhone + "</td></tr>"
                                + "<tr class='topbord'><td class='right'>县级管理单位:</td><td class='left'>" + data[i].Admauth + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AtcunitDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AtcunitDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AtcunitDutyLinkPhone + "</td></tr>"
                                + "<tr class='topbord'><td class='right'>维修单位:</td><td class='left'>" + data[i].MaintainCorp + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].MaintainCorpDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].MaintainCorpDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].MaintainCorpDutyLinkPhone + "</td></tr>"
                                + "</table></td></tr>";
                        }
                        $("#stationHead").html(thead);
                        $("#stationList").html("<tbody>" + tbody + "</tbody>");
                    }
                });
                $("#popupDiv").show();
            }
            //获取服务器信息
            function CompDivPopup(distric, numb) {
                var tbody = "";
                $.ajax({
                    type: "post",
                    async: false,
                    url: "/Home/Test",
                    data: { get: "7", Distric: distric, Type: "'1-1-0-0-0-1-'", State: 0, FType: 1 },
                    success: function (data) {
                        data = eval(data);
                        var count = data.length;
                        for (var i = 0; i < count; i++) {
                            var stateColor = "gray";
                            var state = data[i].State;
                            var stateMes = data[i].StateMessage;
                            var name = data[i].CompName;
                            if (state == "0")
                                stateColor = "red";
                            if (state == "1")
                                stateColor = "yellow";
                            if (state == "2")
                                stateColor = "gray";
                            if (state == "3")
                                stateColor = "green";
                            tbody += "<tr onclick='ShowTr($(this)," + data[i].EquipmentId + ",1)'>";
                            tbody += "<td style='width: 30px;text-align:center;'>" + parseInt(parseInt(i) + 1 + numb) + "</td>";
                            tbody += "<td style='width: 60px;'>" + data[i].DistricName + "</td>";
                            tbody += "<td style='width: 100px;'>服务器</td>";
                            tbody += "<td style='width: 100px;'>" + name + "</td>";
                            tbody += "<td style='width: 360px;padding: 0px;' colspan='3'>" + stateMes + "</td><td style='width: 150px;'>" + data[i].Addr + "</td></tr>";
                            //隐藏的联系人信息 
                            tbody += "<tr style='display:none;' rowspan='3' id='com_" + data[i].EquipmentId + "'><td colspan='8'><table class='linktable'>"
                                + "<tr><td class='left' colspan='8'>服务器IP地址:" + data[i].IpValue + "</td></tr>"
                                + "<tr><td class='left' colspan='8'>服务器运行内容:" + data[i].CompRemark + "</td></tr>"
                                + "<tr class='topbord'><td class='right'>管理单位:</td><td class='left'>" + data[i].Admauth + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].AtcunitDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].AtcunitDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].AtcunitDutyLinkPhone + "</td></tr>"
                                + "<tr class='topbord'><td class='right'>维修单位:</td><td class='left'>" + data[i].MaintainCorp + "</td><td class='right'>负责人:</td><td class='left'>" + data[i].MaintainCorpDutyLinkMan + "</td><td class='right'>职务:</td><td class='left'>" + data[i].MaintainCorpDutyLinkDuty + "</td><td class='right'>联系电话:</td><td class='left'>" + data[i].MaintainCorpDutyLinkPhone + "</td></tr>"
                                + "</table></td></tr>";
                        }

                    }
                }); return tbody;
            }
            //显示或隐藏 联系人列
            function ShowTr(trobj, id, com) {
                var obj = $("#" + id);
                if (com == 1)
                    obj = $("#com_" + id);
                if (obj.attr("style") == "display:black;")
                    obj.attr("style", "display:none;");
                else {
                    //add Mokansa
                    var trScrollTop = trobj.offset().top - 153;
                    var divScrollTop = $("#contentList").scrollTop();
                    var scrollHeight = trScrollTop < divScrollTop ? divScrollTop + 90 : trScrollTop;
                    $("#contentList").animate({ scrollTop: scrollHeight }, 1000);
                    obj.attr("style", "display:black;");
                }
            }
            //弹出地市汇总列表
            function cityTable() {
                map.infoWindow.hide();
                var distric = $("#RadTextBoxDistric").val();
                $("#popupDiv").height(85);
                $("#stationHead").html("");
                $("#divThead").height(49);
                $("#stationList").html("");
                $("#banner").html("设备列表");
                $.ajax({
                    type: "post",
                    //async: false,
                    url: "/Home/Test",
                    data: { get: "10", Distric: distric },
                    success: function (data) {
                        data = eval(data);
                        $("#stationHead").html(data[0].thead);
                        if (data[0].level == "100")
                            $("#popupDiv").width(850);
                        else
                            $("#popupDiv").width(780);
                    }
                });
                $.ajax({
                    type: "post",
                    //async: false,
                    url: "/Home/Test",
                    data: { get: "11", Distric: distric },
                    success: function (data) {
                        data = eval(data);
                        $("#stationList").html("<tbody>" + data[0].table + "</tbody>");
                        var count = data[0].count;
                        var height = parseInt(85 + parseInt(count) * 30);
                        if (height > 440)
                            height = 440;
                        $("#popupDiv").height(height);
                    }
                });
                $("#popupDiv").show();
            }
            //关闭设备状态列表
            function divClose() {
                $("#popupDiv").hide();
            }
            //隐藏图层控制div
            function HideDivLaye() {
                $("#DivLayerHide").show();
                $("#DivLayerShow").hide();
            }
            //显示图层控制div
            function ShowDivLaye() {
                $("#DivLayerHide").hide();
                $("#DivLayerShow").show();
            }
            //1-1-0-0-1-0-	自动雨量监测站       正常=layer10001001  异常=layer10001000
            //1-1-0-0-1-6-	自动水位监测站       正常=layer10001011  异常=layer10001010
            //1-1-0-0-1-2-	简易雨量监测告警站   正常=layer10001021  异常=layer10001020
            //1-1-0-0-1-7-	简易水位监测告警站   正常=layer10001031  异常=layer10001030
            //1-1-0-0-1-5-	图像监测站           正常=layer10001041  异常=layer10001040
            //1-1-0-0-1-8-	视频监测站           正常=layer10001051  异常=layer10001050
            //1-1-0-0-1-3-	预警广播             正常=layer10001061  异常=layer10001060
            //设置图层显示
            function SetLaye() {
                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-0-']").prop("checked")) {
                    if (layer10001000)
                        layer10001000.setVisibility(true);
                }
                else {
                    if (layer10001000)
                        layer10001000.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-0-']").prop("checked")) {
                    if (layer10001001)
                        layer10001001.setVisibility(true);
                }
                else {
                    if (layer10001001)
                        layer10001001.setVisibility(false);
                }

                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-6-']").prop("checked")) {
                    if (layer10001010)
                        layer10001010.setVisibility(true);
                }
                else {
                    if (layer10001010)
                        layer10001010.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-6-']").prop("checked")) {
                    if (layer10001011)
                        layer10001011.setVisibility(true);
                }
                else {
                    if (layer10001011)
                        layer10001011.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-2-']").prop("checked")) {
                    if (layer10001020)
                        layer10001020.setVisibility(true);
                }
                else {
                    if (layer10001020)
                        layer10001020.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-2-']").prop("checked")) {
                    if (layer10001021)
                        layer10001021.setVisibility(true);
                }
                else {
                    if (layer10001021)
                        layer10001021.setVisibility(false);
                }

                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-7-']").prop("checked")) {
                    if (layer10001030)
                        layer10001030.setVisibility(true);
                }
                else {
                    if (layer10001030)
                        layer10001030.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-7-']").prop("checked")) {
                    if (layer10001031)
                        layer10001031.setVisibility(true);
                }
                else {
                    if (layer10001031)
                        layer10001031.setVisibility(false);
                }

                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-5-']").prop("checked")) {
                    if (layer10001040)
                        layer10001040.setVisibility(true);
                }
                else {
                    if (layer10001040)
                        layer10001040.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-5-']").prop("checked")) {
                    if (layer10001041)
                        layer10001041.setVisibility(true);
                }
                else {
                    if (layer10001041)
                        layer10001041.setVisibility(false);
                }

                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-8-']").prop("checked")) {
                    if (layer10001050)
                        layer10001050.setVisibility(true);
                }
                else {
                    if (layer10001050)
                        layer10001050.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-8-']").prop("checked")) {
                    if (layer10001051)
                        layer10001051.setVisibility(true);
                }
                else {
                    if (layer10001051)
                        layer10001051.setVisibility(false);
                }

                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-3-']").prop("checked")) {
                    if (layer10001060)
                        layer10001060.setVisibility(true);
                }
                else {
                    if (layer10001060)
                        layer10001060.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-3-']").prop("checked")) {
                    if (layer10001061)
                        layer10001061.setVisibility(true);
                }
                else {
                    if (layer10001061)
                        layer10001061.setVisibility(false);
                }
                //1-1-0-0-1-9-	简易雨量监测站           正常=layer10001091   异常=layer10001090
                //1-1-0-0-1-10-	简易水位监测站           正常=layer100010101  异常=layer100010100
                //1-1-0-0-1-11-	无线预警广播             正常=layer100010111  异常=layer100010110
                //1-1-0-0-1-12-	简易预警设备             正常=layer100010121  异常=layer100010120
                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-9-']").prop("checked")) {
                    if (layer10001090)
                        layer10001090.setVisibility(true);
                }
                else {
                    if (layer10001090)
                        layer10001090.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-9-']").prop("checked")) {
                    if (layer10001091)
                        layer10001091.setVisibility(true);
                }
                else {
                    if (layer10001091)
                        layer10001091.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-10-']").prop("checked")) {
                    if (layer100010100)
                        layer100010100.setVisibility(true);
                }
                else {
                    if (layer100010100)
                        layer100010100.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-10-']").prop("checked")) {
                    if (layer100010101)
                        layer100010101.setVisibility(true);
                }
                else {
                    if (layer100010101)
                        layer100010101.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-11-']").prop("checked")) {
                    if (layer100010110)
                        layer100010110.setVisibility(true);
                }
                else {
                    if (layer100010110)
                        layer100010110.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-11-']").prop("checked")) {
                    if (layer100010111)
                        layer100010111.setVisibility(true);
                }
                else {
                    if (layer100010111)
                        layer100010111.setVisibility(false);
                }

                if ($("input[name='checkboxState'][value='0']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-12-']").prop("checked")) {
                    if (layer100010120)
                        layer100010120.setVisibility(true);
                }
                else {
                    if (layer100010120)
                        layer100010120.setVisibility(false);
                }
                if ($("input[name='checkboxState'][value='1']").prop("checked") && $("input[name='checkboxType'][value='1-1-0-0-1-12-']").prop("checked")) {
                    if (layer100010121)
                        layer100010121.setVisibility(true);
                }
                else {
                    if (layer100010121)
                        layer100010121.setVisibility(false);
                }
            }
        </script>
        @*     //end*@
        @*start*@
        <div id="Div1" runat="server" style="display: none">
            @Html.TextBox("RadTextBoxId", "", new { style = "width:200px;" })
            @Html.TextBox("RadTextBoxOId", "", new { style = "width:200px;" })
            @Html.TextBox("RadTextBoxDistric", "", new { style = "width:200px;" })
            @Html.TextBox("RadTextBoxAtcunit", "", new { style = "width:200px;" })
          
            <input type="text" id="districcenterTextBox" value="@ViewBag.discenter"}  />
            @Html.TextBox("RadTextBoxEqType", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxMethod", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxZoom1", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxZoom2", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxZoom3", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxZoom4", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxScale1", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxScale2", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxScale3", "", new { style = "width:200px;" })

            @Html.TextBox("RadTextBoxScale4", "", new { style = "width:200px;" })


        </div>
        @* <div style="border-width: 1px; border-style: solid; border-color: #666666; float: left; margin-left: 1px; margin-top: 1px; font-family: 'Microsoft YaHei'"
            id="leftDiv">*@
        @*   <div id="MapLabel" style="background-color: #e2efff; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #666666;">
                <div id="districNav" style="margin-left: 3px; width: 250px;"></div>
                <div style="position: absolute; top: 0; margin-left: 260px;">
                    <img src="Images/citytable.png" style="width: 20px; height: 20px; padding-top: 4px; cursor: pointer;" onclick="cityTable()" id="cityImage" />
                </div>
            </div>*@
        @*   <div id="stateList" runat="server" style="overflow: auto; margin: 2px;">
                <table class="gridtable" style="width: 100%;" id="StationCountList">
                </table>
            </div>*@
    </div>
    <div id="mapDiv" style="overflow: hidden;">
     
        @* <div id="popupDiv" style="display: none;">
                <table class="popupHead" style="width: 100%">
                    <tr>
                        <th id="banner" style="width: 90%; text-align: left; cursor: move;">异常设备列表</th>
                        <th style="cursor: pointer;" onclick="divClose()">×</th>
                    </tr>
                </table>
                <div style="height: 36px; overflow: hidden;" id="divThead">
                    <table id="stationHead" class="gridtable" style="margin: 4px auto 0px 2px;">
                    </table>
                </div>
                <div id="contentList" style="height: 78%; overflow: auto;">
                    <table id="stationList" class="gridtable" style="margin: 0px auto 2px 2px;">
                    </table>
                </div>
            </div>*@
        @* <div id="mapNameDiv">
            </div>*@
        <div class="MapLable" id="DivLayerShow1">
                <div style="text-align: left; background-color: #ccc; border-bottom: 1px solid #666666; line-height: 21px;">
                    
                    <span style="cursor: pointer;" onclick="javascript:kuaijie();">快捷操作</span>
                </div>
            </div>
        
          <div class="MapLableTotal" id="DivLayerShow">
                <div style="text-align: left; background-color: #ccc; border-bottom: 1px solid #666666; line-height: 21px;">
                    
                 
                    <span style="font-size: 15px; font-weight: bold; padding-right: 25px;">汇总统计</span>
                    <span style="cursor: pointer;" onclick="HideDivLaye()">—</span>
                     <table style="text-align: left; width: 100px; height: 20px; margin: 4px 4px 4px 4px;">
                    <tr>
                       
                        <td>
                            <label style="cursor: pointer;">设备总数</label></td>
                        
                        <td>
                            <label id="Total" style="cursor: pointer;""></label></td>
                    </tr>
                     <tr>
                       
                        <td>
                            <label style="cursor: pointer;">正常设备</label></td>
                        
                        <td>
                            <label id="ZTotal" style="cursor: pointer;""></label></td>
                    </tr>
                          <tr>
                       
                        <td>
                            <label style="cursor: pointer;">异常设备</label></td>
                        
                        <td>
                            <label id="YTotal" style="cursor: pointer;""></label></td>
                    </tr>
                </table>
                </div>
            </div>
         @*
                <table style="text-align: left; width: 170px; height: 20px; margin: 4px 4px 4px 4px;">
                    <tr>
                        <td style="width: 15px;">
                            <input type="checkbox" name="checkboxState" onclick="SetLaye()" checked="checked" value="0" title="异常设备" />
                        </td>
                        <td>
                            <label style="cursor: pointer;" onclick="checkedBox(0)">异常设备</label></td>
                        <td style="width: 15px;">
                            <input type="checkbox" name="checkboxState" onclick="SetLaye()" value="1" title="正常设备" /></td>
                        <td>
                            <label style="cursor: pointer;" onclick="checkedBox(1)">正常设备</label></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>(红色)</td>
                        <td></td>
                        <td>(绿色)</td>
                    </tr>
                </table>
                <hr />
                <table style="text-align: left; width: 170px; height: 100px; margin: 4px 4px 4px 4px;" id="tabletype">
                    <asp:Repeater runat="server" ID="RepeaterEType">
                        <ItemTemplate>
                            <tr id='typeCheck_<%#Eval("Id") %>'>
                                <td style="width: 25px;">
                                    <input type="checkbox" onclick="SetLaye()" name="checkboxType" checked="checked" value="<%#Eval("Id") %>" title="<%#Eval("Name") %>>" />
                                </td>
                                <td style="width: 20px; cursor: pointer;" onclick="checkedBox('<%#Eval("Id") %>')">
                                    <img style="width: 15px; height: 15px;" title="<%#Eval("Name") %>" src="<%#Eval("Marking") %>" />
                                </td>
                                <td onclick="checkedBox('<%#Eval("Id") %>')">
                                    <label style="cursor: pointer;"><%#Eval("Name") %></label>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr>
                        <td colspan="3" style="text-align: center;">
                            <input type="button" onclick="choseCheckBox(0)" value="全选" />
                            <input type="button" onclick="choseCheckBox(1)" value="反选" />
                        </td>
                    </tr>
                </table>
            </div>*@
        @*    <div class="MapLable" id="DivLayerHide" style="border: none !important; display: none;">
                <img src="Images/LayerHide.png" height="20" style="cursor: pointer;" onclick="ShowDivLaye()" />
            </div>*@
    </div>
    @*end*@
    <div id="Home_Index_Work_Container" style="overflow: hidden; display: none;">
        @if (DotNet.Service.ServiceManager.Instance.UserService.IsIsAuthorized("Home.Index.ProcessTracking"))
        {
            <div class="panel panel-success mt10 measureTrack" style="min-width: 520px;">
                <h1>流程跟踪
                </h1>
                <div id="Home_List_Index_tabs" class="tabs" currentindex="0">
                    <div class="tabsHeader">
                        <div class="tabsHeaderContent">
                            <ul>
                                <li><a href="javascript:;" onclick="Tracking(1)"><span>施工计量</span></a></li>
                                <li><a href="javascript:;" onclick="Tracking(2)"><span>监理计量</span></a></li>
                                <li><a href="javascript:;" onclick="Tracking(3)"><span>检测计量</span></a></li>
                                <li><a href="javascript:;" onclick="Tracking(4)"><span>驻地监理计量</span></a></li>
                                <li><a href="javascript:;" onclick="Tracking(5)"><span>资金计划</span></a></li>
                                <li><a href="javascript:;" onclick="Tracking(6)"><span>备用金</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <div id="TrakList">
                    </div>
                </div>
            </div>
        }
        <div class="workContainer">
            <div class="panel panel-warning mt10">
                <h1>
                    <span class="pull-right"><a target="navTab" href="/Home/ClaimMore?workStatus=1" class="more"
                        rel="Home.ClaimMore" title="审批流程">更多</a> @*<a target="navTab" href="/WorkFlow/WorksMeasure/BGMeasurePage/4" rel="workflow.measurepage">计量主页</a>*@
                        @*<a target="navTab" href="/Home/TestUI" rel="Home.TestUI">UI测试</a>*@ </span>
                    新到工作
                </h1>
                <div>
                    <table id="Claiming_Home_Index">
                    </table>
                </div>
            </div>
            <div class="panel panel-success mt10">
                <h1>
                    <span class="pull-right"><a target="navTab" href="/Home/ClaimMore?workStatus=2" class="more"
                        rel="Home.ClaimMore" title="审批流程">更多</a></span>待办工作</h1>
                <div>
                    <table id="Claimed_Home_Index">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>



<script>
    jQuery(document).ready(
        function () {
            $('#banner').mousedown(
                function (event) {
                    var isMove = true;
                    var abs_x = event.pageX - $('div#popupDiv').offset().left;
                    var abs_y = event.pageY - $('div#popupDiv').offset().top;
                    $(document).mousemove(function (event) {
                        if (isMove) {
                            var obj = $('div#popupDiv');
                            obj.css({ 'left': event.pageX - abs_x, 'top': event.pageY - abs_y });
                        }
                    }
                    ).mouseup(
                        function () {
                            isMove = false;
                        }
                    );
                }
            );
            $.ajax({
                type: "post",
                url: "/Home/GetMeterTotal",
                data: { get: "1" },
                success: function (data) {
                    
                     data = eval(data);
                     document.getElementById("Total").innerHTML = data[0].Total;
                     document.getElementById("ZTotal").innerHTML = data[0].ZTotal;
                     document.getElementById("YTotal").innerHTML = data[0].YTotal;
                },
                error: function () {

                }
            });
            
        }
    );
</script>

